package com.example.haoyundaoyonghu;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.alibaba.fastjson.JSON;

import com.example.haoyundaoyonghu.R;
import com.example.haoyundaoyonghu.base.AuthorModel;
import com.example.haoyundaoyonghu.base.BaseActivity;
import com.example.haoyundaoyonghu.base.ServiceMethod;
import com.vise.log.ViseLog;
import com.vise.xsnow.http.ViseHttp;
import com.vise.xsnow.http.callback.ACallback;

import butterknife.BindView;
import butterknife.OnClick;

public class MainActivity extends BaseActivity {

    @BindView(R.id.button)
    Button button;

    @BindView(R.id.button2)
    Button button2;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected int setLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    protected void init() {
//        Log.i("TAG", "onSuccess: data:"+data);
        String interfaceName = ServiceMethod.SECURITY_CODE.getInterfaceName();
        Log.i("TAG", "onViewClicked: :" + interfaceName);
        AuthorModel mAuthorModel = new AuthorModel();
        mAuthorModel.setPhone("13438459615");
        mAuthorModel.setType(0);
        String s = JSON.toJSONString(mAuthorModel);
        ViseHttp.BASE(new )
                .tag("request_post_3")
                .setJson(JSON.toJSONString(mAuthorModel))
                .request(new ACallback<String>() {
                    @Override
                    public void onSuccess(String data) {
                        ViseLog.i("TAG", "onSuccess: data:"+data);
                    }

                    @Override
                    public void onFail(int errCode, String errMsg) {

                    }
                });
    }


    @OnClick({R.id.button, R.id.button2})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.button:
                break;
            case R.id.button2:
                break;
        }
    }
}
